#include<stdio.h>
#include<stdlib.h>
int compare(const void *a,const void *b){
    return (*(int *)a-*(int *)b);
}
int queue[2000];
int sz[1000000];
int main(){
    int n;
    scanf("%d",&n);
    int head=0;
    int tail=0;
    queue[tail]=1;
    tail++;
    int sum=1;
    sz[sum]=1;
    while(tail<100){
        qsort(queue,tail,sizeof(int),compare);
        int f=queue[head];
        if(!sz[2*f+1]){
        sz[2*f+1]=1;
        queue[tail]=2*f+1;
        tail++;
        }
        if(!sz[3*f+1]){
        sz[3*f+1]=1;
        queue[tail]=3*f+1;
        tail++;
        }
        head++;
    }
    qsort(queue,100,sizeof(int),compare);
    for(int i=0;i<n-1;i++)
    {
        printf("%d ",queue[i]);
    }
    printf("%d",queue[n-1]);
    return 0;
}